/**
 * Created by xc on 2017/11/21.
 */

var common = require('../../common');
var pool = require('../index');
var mysql = require('mysql');
var YjxBaseModel = require('./YjxBaseModel');
var async  = require( 'async'); // 同步控制

//--------------------------------------------------------------------------------------
// Schema 结构
var YjxTradeStateHisModel = function(obj){
    YjxBaseModel.call(this,obj);

    // 以下为表定义数据，需要的字段就填入
    //`his_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '纪录id',
    //`trade_type` int(3) NOT NULL DEFAULT '0' COMMENT '类型:10商品订单,20发票,30购买模版,40虚拟商品(如vip),50秒杀订单',
    //`trade_obj_id` bigint(20) NOT NULL COMMENT '订单id/发票id/购买id',
    //`state` int(3) NOT NULL DEFAULT '0' COMMENT '订单/发票状态: 参照订单/发票表',
    //`total_fee` bigint(12) NOT NULL DEFAULT '0' COMMENT '订单总金额（单位为rmb分）',
    //`user_id` bigint(20) DEFAULT NULL COMMENT '用户id',
    //`desc` varchar(200) DEFAULT NULL COMMENT '备注信息',
    //`create_time` datetime NOT NULL,
    //`update_time` datetime NOT NULL,
    //`update_by` varchar(50) NOT NULL,
    //`del_flg` int(1) NOT NULL DEFAULT '0',

};

YjxTradeStateHisModel.prototype = new YjxBaseModel();

// 取得表名
YjxTradeStateHisModel.prototype.getTableName = function(){
    return 'yjx_trade_state_his';
};
// 取得查询语句中where 后面匹配主键的条件（需要各派生类进行重载）
YjxTradeStateHisModel.prototype.getWhereConditionOfKeyEqual = function(){
    return 'his_id='+this.his_id;
};


//--------------------------------------------------------------------------------------



//--------------------------------------------------------------------------------------
// 导出
module.exports = YjxTradeStateHisModel;